Skip to content

Fix Issue 21294 - Improve unhelpful error message with duplicate name… - #23821

Open
usefahmed07 wants to merge 1 commit into
dlang:masterfrom
usefahmed07:fix-21294
Open

Fix Issue 21294 - Improve unhelpful error message with duplicate name…#23821
usefahmed07 wants to merge 1 commit into
dlang:masterfrom
usefahmed07:fix-21294

Conversation

@usefahmed07

Copy link
Copy Markdown
Contributor

Fixes #21294

…d argument in overload set

Named-argument errors (e.g. "parameter assigned twice") were only
reported via checkNamedArgErrorAndReportOverload() when the symbol
was an OverDeclaration (od). Plain function overloads declared in
the same scope use the fd.overnext chain instead, so the
hasOverloads branch in resolveFuncCall() never ran this check and
fell back to the generic "none of the overloads are callable"
message.

Call checkNamedArgErrorAndReportOverload(fd, ...) in that branch
too, since overloadApply() already supports walking fd.overnext.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhelpful error message with duplicate named argument when calling overload set

1 participant